<?php

/**
 * Contains a class to define a Flag object to describe an item flag.
 *
 * PHP Version 5
 *
 * @category BuyLocal
 * @package  BuyLocal
 * @author   Kevin Fodness <kevin.fodness@gmail.com>
 * @author   Mike Pennisi <mpennisi@andrew.cmu.edu>
 * @author   Aaron Ryden <aryden@gmail.com>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://code.google.com/p/buylocalopensourcerensselaer/
 */
 
/**
 * A class to define a Flag object to describe an item flag.
 *
 * @category BuyLocal
 * @package  BuyLocal
 * @author   Kevin Fodness <kevin.fodness@gmail.com>
 * @author   Mike Pennisi <mpennisi@andrew.cmu.edu>
 * @author   Aaron Ryden <aryden@gmail.com>
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
 * @link     http://code.google.com/p/buylocalopensourcerensselaer/
 */ 
class Flag
{
    /**
     * The database unique ID for the flag.
     *
     * @access public
     * @var int       Corresponds to flags.flagid
     */
    public $id;
    
    /**
     * A FlagType object describing the type of flag.
     *
     * @access public
     * @var object    Corresponds to flags.flagtype
     */
    public $flagType;
    
    /**
     * An object containing the offending item (User, Product, Store, etc).
     *
     * @access public
     * @var object    Corresponds to flags.item
     */
    public $item;
    
    /**
     * The IP address that logged the flag.
     *
     * @access public
     * @var string    Corresponds to flags.ipaddress
     */
    public $ipAddress;
    
    /**
     * The UNIX timestamp for the date & time the flag was created.
     *
     * @access public
     * @var int       Corresponds to flags.createdate
     */
    public $createDate;
    
    /**
     * A boolean flag for whether the flag is resolved or not.
     *
     * @access public
     * @var bool      Corresponds to flags.isresolved
     */
    public $isResolved;
    
    /**
     * Constructor function.  Populates variables based on parameters.
     *
     * @param int    $id         The unique ID for the flag.
     * @param object $flagType   The flag type.
     * @param object $item       The offending item.
     * @param string $ipAddress  The IP address that logged the flag.
     * @param int    $createDate The date and time the flag was created.
     * @param bool   $isResolved Whether the flag is resolved yet or not.
     *
     * @access public
     * @return null
     */
    public function __construct($id = null, $flagType = null, $item = null,
        $ipAddress = null, $createDate = null, $isResolved = null
    ) {
        $this->id         = $id;
        $this->flagType   = $flagType;
        $this->item       = $item;
        $this->ipAddress  = $ipAddress;
        $this->createDate = $createDate;
        $this->isResolved = $isResolved;
    }
}

?>